package com.yuyou.fn.tms.vo;

import com.yuyou.fn.common.util.BigDecimals;
import com.yuyou.fn.educational.entity.CourseClass;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;

/**
 * Created by lzh on 2019/2/21.
 */
public class ClassFee {
    @ApiModelProperty("班级id")
    private Long claId;
    @ApiModelProperty("剩余学位")
    private Integer surplusQuota;
    @ApiModelProperty("学费")
    private BigDecimal claFee;
    @ApiModelProperty("资料费")
    private BigDecimal claMaterialFee;

    public ClassFee(CourseClass courseClass){
        Integer regAmount=courseClass.getRegAmount()==null?0:courseClass.getRegAmount();
        Integer lockAmount=courseClass.getLockAmount()==null?0:courseClass.getLockAmount();
        this.setClaId(courseClass.getClassId());
        this.setClaFee(courseClass.getStudyingFee());
        this.setClaMaterialFee(courseClass.getMaterialFee());
        this.setSurplusQuota(courseClass.getQuota()-regAmount-lockAmount);
    }

    public Long getClaId() {
        return claId;
    }

    public void setClaId(Long claId) {
        this.claId = claId;
    }

    public Integer getSurplusQuota() {
        return surplusQuota;
    }

    public void setSurplusQuota(Integer surplusQuota) {
        this.surplusQuota = surplusQuota;
    }

    public BigDecimal getClaFee() {
        return claFee;
    }

    public void setClaFee(BigDecimal claFee) {
        this.claFee = claFee;
    }

    public BigDecimal getClaMaterialFee() {
        return claMaterialFee;
    }

    public void setClaMaterialFee(BigDecimal claMaterialFee) {
        this.claMaterialFee = claMaterialFee;
    }
}
